The present invention relates to an inference apparatus in which an inference is conducted by use of ambiguous knowledge of experts in a computer.
FIG. 1 shows a configuration diagram of a conventional multi-stage inference apparatus. This system includes a data input section 101 for receiving input data from an external device, a work area 102 for storing therein the input data and an intermediate result of an inference, an inference rule store section 103 for storing therein a plurality of inference rules, an inference engine section 104 for receiving as an input thereto the data stored in the work area 102 so as to achieve a multistage inference thereon based on inference rules loaded in the inference rule store section 103, and a result output section 105 for producing an inference result.
The inference rules stored in the inference rule storage 103 are represented in a form of:
if (antecedent) then (consequent), where the consequent includes an instruction of a variable operation, an instruction to write an intermediate inference result in a work area, an instruction of a device operation, and the like. FIG. 2 shows an example of a knowledge base comprising a plurality of inference rules, which will be next described. Knowledge items of experts are accumulated to be stored in a knowledge base 24. Ordinarily, the knowledge is subdivided into knowledge sources such as a knowledge source 201 related to stock exchange and a knowledge source 202 associated with capital investment for a firm or company (B). A knowledge base includes a plurality of such knowledge sources each containing a plurality of production rules. For example, the knowledge source 201 includes production rules such as "If the amount is less than 10 million yen and the share price of the firm A is at least 800 l yen, sell the 10 thousand shares of the firm A" and "If the amount remaining is at least 10 million yen, do not sell shares". For these rules, during an inference execution, when a new input data item is received, for example, as "The amount is eight million yen and the share price of the firm A is increased to 1000 yen", the first production rule stored in the knowledge source 201 is activated or fired so as to pass control to the next knowledge source, namely, the knowledge source B. If the profit of the stock exchange results in 1.5 million yen, the first production rule of the subsequent knowledge source 02 is fired. Through the multi-stage inference from the knowledge source A to the knowledge source B, an intermediate inference result is attained as "Conduct capital investment of 500 thousand yen for the firm B".
On the other hand, in the inference method of if (antecedent) then (consequent), there may be used a fuzzy inference.
A description will now be given of a method of determining a control quantity or amount based on the conventional fuzzy inference.
For example, let us consider a simple temperature control for keeping a room temperature at a predetermined value. A relationship between two inputs including a difference e between the room temperature and a target temperature and a change rate de thereof and a control output (operation quantity or amount) u representing a caloric energy of a heater can be described in the If and Then rule as follows. EQU IF e is Approximate Zero and de is Positive Medium THEN u is Negative Medium. (1)
The inference rule of the expression (1) means that if the room temperature is near the target temperature and is increasing at an intermediate magnitude (gradually), decrease the caloric energy to an intermediate level. A fuzzy control (inference) is achieved by preparing a plurality of these inference rules. For example, the following second rule is disposed. EQU IF e is Approximate Zero and de is Approximate Zero THEN u is Negative Small,
where the portions of IF--, THEN--, and "e is Approximate Zero", and "U is Negative Medium" are respectively called an antecedent, a consequent, an antecedent proposition or statement, and a consequent proposition. Items such as Approximate Zero and Positive Medium are labels representing input and output fuzzy numbers employed in the rule descriptions and are called fuzzy variables. FIG. 3 shows an example of the fuzzy variables. Ordinarily, a fuzzy variable is set as a membership function having a symmetrical triangular contour. Fuzzy variables commonly adopted include Negative Big (NB), Negative Medium (NM), Negative Small (NS), Approximate Zero (ZO), Positive Small (PS), Positive Medium (PM), and Positive Big (PB) (FIG. 3).
Next, a description will be given of a fuzzy inference process. As input values actually obtained from various sensors, ordinary real numbers e.sup.o and de.sup.o are measured so as to attain a fuzzy number as a final result of an inference rule (first rule) from the expression (1) as follows. EQU .mu..sub.1 (u)=.mu..sub.Zo (e.sup.o).LAMBDA..mu..sub.PM (de.sup.o).LAMBDA..mu.NM(u)
where .LAMBDA. designates min and fuzzy data F.sup.o is a fuzzy number of a rectangular form similar to a fuzzy variable. FIG. 4 shows a fuzzy variable .mu..sub.1 (u). As can be seen from FIG. 4, the value of .mu..sub.1 (u) is attained as follows. Namely, a degree (membership value) .mu..sub.Zo (e.sup.o) of e.sup.o belonging to a fuzzy number ZO of the antecedent is compared with a degree .mu..sub.PM (ye.sup.o) of de.sup.o belonging to a fuzzy number PM such that the degree .mu..sub.Zo (e.sup.o) having the smallest value is used to cut or clip (min) the fuzzy variable NM of the consequent, thereby obtaining .mu..sub.1 (u).
Since a plurality of control rules (1) are used, a fuzzy number T is obtained by combining the fuzzy numbers of all final results by use of the expression (2) as follows. EQU .mu..sub.T (u)=.mu..sub.1 (u)V.mu..sub.2 (u)V . . . V.mu..sub.n (u)
where V stands for max. As an example, FIG. 5 shows a case (n=2) associated with the first and second rules in which .mu..sub.T (u)=.mu..sub.1 (u)V.mu..sub.2 (u) is obtained. The fuzzy number T is a final fuzzy number representing a control operation quantity; however, the actual control operation quantity u.sup.o is not a fuzzy number but a real number. In consequence, the final result (control operation quantity) u.sup.o is determined by use of an equation presented by the following expression (FIG. 5). ##EQU1##
In this connection, although a method of Mamdani has been here described as the inference method, alternative methods are also possible. For example, for the weighted center of gravity of the expression (3), a center value or a maximum value of the resultant fuzzy number may be used.
The operation quantity u.sup.o thus produced is adopted as a control quantity based on the fuzzy inference so as to be used as an operator for a control object.
The conventional inference apparatus including the apparatus above cannot appropriately handle an ambiguous or fuzzy inference. Moreover, such a fuzzy inference apparatus is not provided with a backtracking operation, which is a function associated with a multi-stage inference and a repetitions inference operation. In consequence, there have been heretofore desired a method and an apparatus thereof in which a multi-stage inference is also possible for an ambiguous inference in consideration of the backtracking operation such as in the conventional inference.